package hotciv.framework;

/** Collection of constants used in HotCiv Game. Note that strings are
 * used instead of enumeration types to keep the set of valid
 * constants open to extensions by future HotCiv variants.  Enums can
 * only be changed by compile time modification.

   From the book "Flexible, Reliable Software Explained"
   To be published 2010 by CRC Press
   Author: 
     Henrik B Christensen 
     Department of Computer Science
     University of Aarhus
   
   This source code is provided AS-IS. It can be
   freely distributed as long as this acknowledgement
   is maintained.
*/
public class GameConstants 
{
	// The size of the world is set permanently to a 16x16 grid 
	public static final int WORLDSIZE = 16;
	// Valid unit types
	public static final String ARCHER    = "archer";
	public static final String LEGION    = "legion";
	public static final String SETTLER   = "settler";
	// Valid terrain types
	public static final String PLAINS    = "plains";
	public static final String OCEANS    = "ocean";
	public static final String FOREST    = "forest";
	public static final String HILLS     = "hills";
	public static final String MOUNTAINS = "mountain";
	// Valid production balance types
	public static final String productionFocus = "hammer";
	public static final String foodFocus = "apple";
	//Units Attack power
	public static final int archerAttack=2;
	public static final int legionAttack=4;
	public static final int settlerAttack=0;
	//Units Defense power
	public static final int archerDefense=3;
	public static final int legionDefense=2;
	public static final int settlerDefense=3;
	
	/*
	 *@return the production cost of each type of unit, 0 if type is not a legal unit-type
	 *@param type the type of this unit
	 */
	public static int productionCost(String type)
	{
		if(type.equals(ARCHER))
		{
			return 10;
		}
		else if(type.equals(LEGION))
		{
			return 15;
		}
		else if(type.equals(SETTLER))
		{
			return 30;
		}
		return 0;
	}
}
